/*
 * @Author: SimonCK666 SimonYang223@163.com
 * @Date: 2022-05-07 20:24:35
 * @LastEditors: SimonCK666 SimonYang223@163.com
 * @LastEditTime: 2022-05-07 20:33:00
 * @FilePath: \golang-concept\L4_gofunc\type.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*
 * @Author: SimonCK666 SimonYang223@163.com
 * @Date: 2022-05-07 20:24:35
 * @LastEditors: SimonCK666 SimonYang223@163.com
 * @LastEditTime: 2022-05-07 20:31:15
 * @FilePath: \golang-concept\L4_gofunc\type.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package main

import (
	"fmt"
)

func sum_type(a int, b int) int {
	return a + b
}

func max_type(a int, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func type_opt() {
	type f1 func(int, int) int
	var ff f1
	ff = sum_type
	res := ff(1, 2)
	fmt.Println(res)

	ff = max_type
	r := ff(1, 2)
	fmt.Println(r)
}
